#ifndef STDAFX_H
#define STDAFX_H

#include "lib_acl.h"
#include "acl_cpp/lib_acl.hpp"
#include "fiber/libfiber.h"

#define  USE_CPP11
#include "fiber/libfiber.hpp"
#include "fiber/http_server.hpp"
#include "fiber/go_fiber.hpp"

#include "patch.h"

#include <string>
#include <map>
#include <QDebug>

// __cplusplus show c++ version as below:
// 199711L: c++98, 201103L: c++11, 201402L: c++14, 201703L: c++17

#include <functional>

typedef acl::HttpServletRequest  HttpRequest;
typedef acl::HttpServletResponse HttpResponse;

typedef std::function<bool(HttpRequest&, HttpResponse&)> http_handler_t;
typedef std::function<bool(const char*, HttpRequest&, HttpResponse&)>
    http_default_handler_t;

typedef std::map<acl::string, http_handler_t> http_handlers_t;

enum {
    http_handler_get = 0,
    http_handler_post,
    http_handler_head,
    http_handler_put,
    http_handler_patch,
    http_handler_connect,
    http_handler_purge,
    http_handler_delete,
    http_handler_options,
    http_handler_profind,
    http_handler_websocket,
    http_handler_error,
    http_handler_unknown,
    http_handler_max,
};

#endif // STDAFX_H
